package com.blueocean_health.care.management.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.blueocean_health.care.management.domain.base.Power;
import com.blueocean_health.care.management.domain.base.Role;
import com.blueocean_health.care.management.domain.dto.RoleDto;
import com.blueocean_health.care.management.util.MyMapper;

public interface RoleMapper extends MyMapper<Role> {

	/**
	 * 当前用户，组织/项目下的所有角色 
	 * @return
	 */
	List<RoleDto> findAllRoleByUserIdAndOrgId(@Param("userId")Integer userId, @Param("orgId")Integer orgId);
	
	/**
	 * 根据角色id列表查询所有权限
	* @Title: findAllPowerByRoleIds
	* @param roleIds
	* @return
	* List<Power>
	* @version V1.0
	* @throws
	 */
	List<Power> findAllPowerByRoleIds(@Param("roleIds") List<Integer> roleIds);
	
	/**
	 * 查询组织的所有权限
	 * @param paramsMap
	 * @return
	 */
	List<String> findTeamPowersByTeamId(Map<String, String> paramsMap);
	
	/**
	 * 权限列表取并集
	 * @param paramsMap
	 * @return
	 */
	List<String> findAllUserPermissionByUserIdAndTeamId(Map<String, String> paramsMap);
}